package com.huirui.server.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.huirui.server.constant.OrderStatus;
import lombok.Data;

/**
 * 订单表
 * @TableName t_order
 */
@TableName(value ="t_order")
@Data
public class Order implements Serializable {
    /**
     * 订单ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单编号（唯一）
     */
    @TableField(value = "order_no")
    private String orderNo;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 订单总金额
     */
    @TableField(value = "total_amount")
    private BigDecimal totalAmount;

    /**
     * 订单状态：0-待付款，1-待发货，2-待收货，3-已完成，4-已取消，5-售后
     */
    @TableField(value = "status")
    private OrderStatus status;

    /**
     * 收货人姓名
     */
    @TableField(value = "receiver_name")
    private String receiverName;

    /**
     * 收货人电话
     */
    @TableField(value = "receiver_phone")
    private String receiverPhone;

    /**
     * 收货地址
     */
    @TableField(value = "receiver_address")
    private String receiverAddress;

    /**
     * 用户备注
     */
    @TableField(value = "customer_note")
    private String customerNote;

    /**
     * 商家备注
     */
    @TableField(value = "merchant_note")
    private String merchantNote;

    /**
     * 支付时间
     */
    @TableField(value = "pay_time")
    private LocalDateTime payTime;

    /**
     * 发货时间
     */
    @TableField(value = "delivery_time")
    private LocalDateTime deliveryTime;

    /**
     * 确认收货时间
     */
    @TableField(value = "receive_time")
    private LocalDateTime receiveTime;

    /**
     * 取消单时间
     */
    @TableField(value = "cancel_time")
    private LocalDateTime cancelTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 0-普通订单，1-秒杀订单
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 支付方式（0-微信支付，1-余额支付）
     */
    @TableField(value = "payment_method")
    private Integer paymentMethod;

    /**
     * 订单实际支付金额
     */
    @TableField(value = "actual_payment")
    private BigDecimal actualPayment;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;



}